import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

import type { App } from 'vue'

const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

// 安装 Pinia 到 Vue 应用
export const setupPinia = (app: App) => {
  app.use(pinia)
}

// 导出 pinia 实例
export default pinia
